\begin{tikzpicture}

	\begin{timelinediagram}

		\renewcommand{\timestepvector}{0,-0.8}

		% initial timelines

		\path (0,0) node (timelineanchor) {};
		\newtimeline{client}
		\path (client) node[above=2pt, align=center] (clientlabel) {\normalsize Client\\};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{servermain}
		\path (servermain) node[above=2pt, align=center] (serverlabel) {\normalsize Server\\};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverep}
		\node[draw, fill=white, align=center, dropshadow] at (serverep) (ep) {RPC\\Entrypoint};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverobjpool}
		\node[draw, fill=white, align=center, dropshadow] at (serverobjpool) (objpool) {Object\\pool};
	
		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverrpcobj}
		\node[draw, fill=white, align=center, dropshadow] at (serverrpcobj) (rpcobj) {RPC object\\ \textbf{a}};

		\activate{client}
		\timestep

		% invoke capability

		\transition{client}{serverep}{}
		\node[align=center] at (transitionlabel) {invoke \\ \textbf{$cap_a$}};
		\timestep
		\transition{serverep}{serverobjpool}{}
		\node[align=center] at (transitionlabel) {lookup by \\ \textbf{$cap_a$}};
		\timestep
		\renewcommand{\timestepvector}{0,-0.4}
		\draw[timelinemessage, dashed, shorten >= 0.0ex] (serverobjpool) -- node[above] {$lookup$} (serverrpcobj);
		\renewcommand{\timestepvector}{0,-0.8}
		\timestep
		\transition{serverobjpool}{serverep}{return \textbf{a}}
		\timestep
		\transition{serverep}{serverrpcobj}{dispatch}
		\renewcommand{\timestepvector}{0,-1}
		\timestep
		% remember current serverrpcobj position as node rpcfunction
		\node at (serverrpcobj) (rpcfunction) {};
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}
		\transition{serverrpcobj}{serverep}{}
		% draw rpcfunction label on top of activetimeline of serverrpcobj
		\node[rotate=90] at (rpcfunction) {RPC function};
		\timestep
		\transition{serverep}{client}{reply}
		\timestep

	\end{timelinediagram}

	\begin{scope}[on background layer]
	\node[timelinegroup, fit=(serverlabel)  (serverrpcobj) (rpcobj)] {};
	\node[timelinegroup, fit=(clientlabel)  (client)] {};
	\end{scope}

\end{tikzpicture}
